<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/resources/include.jsp"%>
<!DOCTYPE HTML>
<HTML>
<HEAD>
<base href="${basePath}">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<TITLE>用户登录</TITLE>
<link rel="stylesheet" href="resources/JSLIB/dojo/dijit/themes/claro/claro.css" >
<link rel="stylesheet" href="resources/JSLIB/plugins/jquery/zTree/css/zTreeStyle/zTreeStyle.css" >
<link rel="stylesheet" href="resources/CSS/login/images/User_Login.css" >
<script src="resources/JSLIB/jquery/jquery-1.7.2.min.js"></script>
<script src="resources/JSLIB/plugins/jquery/zTree/jquery.ztree.all-3.5.min.js"></script>
<script src="resources/JSLIB/dojo/dojo/dojo.js" data-dojo-config="parseOnLoad:true, async:true"></script>
<script type="text/javascript">
    var username = '';
</script>
</HEAD>
<BODY id="userlogin_body" class="claro">
<FORM data-dojo-type="dijit/form/Form" method="POST" action="authenticate/account" id="loginForm">
<DIV id="user_login">
<DL>
  <DD id="user_top">
  <UL>
    <LI class="user_top_l"></LI>
    <LI class="user_top_c"></LI>
    <LI class="user_top_r"></LI>
  </UL>
  <DD id="user_main">
  <UL>
    <LI class="user_main_l"></LI>
    <LI class="user_main_c">
        <DIV class="user_main_box">
        <UL>
          <LI class="user_main_text">用户名:&nbsp;&nbsp;</LI>
          <LI class="user_main_input">
          <input data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props="required:true,readonly:true" id="username" cType="s" onclick="showUserTree(this,'userId');" />
          <input id="userId" name="userId" type="hidden" />
          </LI>
        </UL>
        <UL>
          <LI class="user_main_text">密&nbsp;&nbsp;&nbsp;&nbsp;码:&nbsp;&nbsp;</LI>
          <LI class="user_main_input">
          <INPUT data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props="required: true" type="password" name="password" id="password" />
          </LI>
        </UL>
        </DIV>
    </LI>
    <LI class="user_main_r"><INPUT class="IbtnEnterCssClass" style="BORDER: 0px;cursor: pointer;" type="button" onclick="loginSubmitForm('loginForm')"/></LI>
  </UL>
  <DD id="user_bottom">
  <UL>
    <LI class="user_bottom_l"></LI>
    <LI class="user_bottom_c"></LI>
    <LI class="user_bottom_r"></LI>
  </UL>  
</FORM>
<script type="text/javascript">
require([], function() {
    loginSubmitForm = function(formId) {
        var form = dijit.byId(formId);
        if(form.isValid()){
            form.submit();
        }else{
            form.validate();
        }
    };
});
require([ "dojo/dom", "dojo/query", "dijit/popup", "dojox/layout/ContentPane" ], function(dom, query, popup, ContentPane) {
    showUserTree = function(obj, realId) {
        var url = "sysuser/dropTree?dropId=" + obj.id + "&cType=" + (obj.ctype || obj.cType) + "&keyId=" + realId;
        var userdropTreePane = new ContentPane({
            href : url,
            style : 'width: 165px;height:250px;background: #f0f6e4;border: solid 1px #85B5D9;',
            onMouseLeave : function() {
                popup.close(this);
                this.destroy();
            },
            onClose : function() {
                popup.close(this);
                this.destroy();
            }
        });
        query("[dijitpopupparent|=\""+obj.id+"\"]").forEach(function(node){
            node.parentNode.removeChild(node);
        });
        popup.open({
            parent : obj,
            popup : userdropTreePane,
            around : obj.domNode
        });
        userdropTreePane.startup();
    };
});
</script>
</BODY>
</HTML>